Remove GdkGLContext::visual
authorAlexander Larsson <alexl@redhat.com>
Thu, 30 Oct 2014 11:15:51 +0000 (12:15 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 30 Oct 2014 11:43:03 +0000 (12:43 +0100)
This is not really needed. The gl context is totally tied to the
window it is created from by virtue of sharing the context with the
paint context of that window and that context always has the visual
of the window (which we already can get).

Also, all user visible contexts are essentially offscreen contexts, so
a visual doesn't make sense for them. They only use FBOs which have
whatever format that the users sets up.

docs/reference/gdk/gdk3-sections.txt
gdk/gdkglcontext.c
gdk/gdkglcontext.h
gdk/wayland/gdkglcontext-wayland.c
gdk/x11/gdkglcontext-x11.c

index 8281d5353238bcf144cd5ec80c24f964f85e34a4..97ef4f75a729ad01d65b757f399dd4fc8903e084 100644 (file)
@@ -1286,7 +1286,6 @@ gdk_frame_get_type
 <SECTION>
 <FILE>gdkglcontext</FILE>
 GdkGLContext
-gdk_gl_context_get_visual
 gdk_gl_context_get_window
 gdk_gl_context_make_current
 gdk_gl_context_clear_current
index b15b76eaddccba5c977a509788882f63080a85dd..f64c23d13694e2e800759293027c71b4fd1578ac 100644 (file)
@@ -72,7 +72,6 @@
 
 #include "gdkglcontextprivate.h"
 #include "gdkdisplayprivate.h"
-#include "gdkvisual.h"
 #include "gdkinternals.h"
 
 #include "gdkintl.h"
@@ -81,7 +80,6 @@
 
 typedef struct {
   GdkWindow *window;
-  GdkVisual *visual;
   GdkGLContext *shared_context;
 
   guint realized : 1;
@@ -93,7 +91,6 @@ enum {
   PROP_0,
 
   PROP_WINDOW,
-  PROP_VISUAL,
   PROP_SHARED_CONTEXT,
 
   LAST_PROP
@@ -119,7 +116,6 @@ gdk_gl_context_dispose (GObject *gobject)
     g_private_replace (&thread_current_context, NULL);
 
   g_clear_object (&priv->window);
-  g_clear_object (&priv->visual);
   g_clear_object (&priv->shared_context);
 
   G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject);
@@ -149,15 +145,6 @@ gdk_gl_context_set_property (GObject      *gobject,
       }
       break;
 
-    case PROP_VISUAL:
-      {
-        GdkVisual *visual = g_value_get_object (value);
-
-        if (visual != NULL)
-          priv->visual = g_object_ref (visual);
-      }
-      break;
-
     case PROP_SHARED_CONTEXT:
       {
         GdkGLContext *context = g_value_get_object (value);
@@ -186,10 +173,6 @@ gdk_gl_context_get_property (GObject    *gobject,
       g_value_set_object (value, priv->window);
       break;
 
-    case PROP_VISUAL:
-      g_value_set_object (value, priv->visual);
-      break;
-
     case PROP_SHARED_CONTEXT:
       g_value_set_object (value, priv->shared_context);
       break;
@@ -220,22 +203,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
                          G_PARAM_CONSTRUCT_ONLY |
                          G_PARAM_STATIC_STRINGS);
 
-  /**
-   * GdkGLContext:visual:
-   *
-   * The #GdkVisual matching the pixel format used by the context.
-   *
-   * Since: 3.16
-   */
-  obj_pspecs[PROP_VISUAL] =
-    g_param_spec_object ("visual",
-                         P_("Visual"),
-                         P_("The GDK visual used by the GL context"),
-                         GDK_TYPE_VISUAL,
-                         G_PARAM_READWRITE |
-                         G_PARAM_CONSTRUCT_ONLY |
-                         G_PARAM_STATIC_STRINGS);
-
   /**
    * GdkGLContext:shared-context:
    *
@@ -264,26 +231,6 @@ gdk_gl_context_init (GdkGLContext *self)
 {
 }
 
-/**
- * gdk_gl_context_get_visual:
- * @context: a #GdkGLContext
- *
- * Retrieves the #GdkVisual associated with the @context.
- *
- * Returns: (transfer none): the #GdkVisual
- *
- * Since: 3.16
- */
-GdkVisual *
-gdk_gl_context_get_visual (GdkGLContext *context)
-{
-  GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
-
-  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
-
-  return priv->visual;
-}
-
 /*< private >
  * gdk_gl_context_end_frame:
  * @context: a #GdkGLContext
index 5dbd57e2c4f806ad25338bcf12b3796744c09616..599ec99435f2e04367f81d6003fd9eb8c5ff7b4f 100644 (file)
@@ -42,8 +42,6 @@ GQuark gdk_gl_error_quark (void);
 GDK_AVAILABLE_IN_3_16
 GType gdk_gl_context_get_type (void) G_GNUC_CONST;
 
-GDK_AVAILABLE_IN_3_16
-GdkVisual *             gdk_gl_context_get_visual       (GdkGLContext *context);
 GDK_AVAILABLE_IN_3_16
 GdkWindow *             gdk_gl_context_get_window       (GdkGLContext *context);
 
index ee8782d3ea27750bd6c6f7781f1cbe000cc85782..7af884e7f071ead63ac025fc8f1991f0ce749bb3 100644 (file)
@@ -363,7 +363,6 @@ gdk_wayland_window_create_gl_context (GdkWindow     *window,
 
   context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
                           "window", window,
-                          "visual", gdk_window_get_visual (window),
                           "shared-context", share,
                           NULL);
 
index 071f8a1319a1a776a28a7769945d8a029551b357..e1a578e4300a634dd70c716e4caca094578e5b0f 100644 (file)
@@ -997,7 +997,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
   GdkDisplay *display;
   GdkX11GLContext *context;
   GdkVisual *visual;
-  GdkVisual *gdk_visual;
   GLXFBConfig config;
   GLXContext glx_context;
   GLXWindow drawable;
@@ -1106,9 +1105,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
       set_glx_drawable_info (window->impl_window, info);
     }
 
-  gdk_visual = gdk_x11_screen_lookup_visual (gdk_display_get_default_screen (display),
-                                             xvisinfo->visualid);
-
   XFree (xvisinfo);
 
   if (attached)
@@ -1123,7 +1119,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
 
   context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
                           "window", window,
-                          "visual", gdk_visual,
                           "shared-context", share,
                           NULL);